use rocket::Route;
use serde::{Deserialize, Serialize};
use rocket_contrib::json::Json;

#[derive(Deserialize)]
struct AdminsUsr {
    name: String ,
    pwd:  String
}

#[derive(Serialize)]
struct DwbUsr {
    name:String,
    pwd: String
}

#[post("/get_auth", data="<usr>")]
fn post_admin_login(usr:Json<AdminsUsr>) ->Json<DwbUsr>
{
    Json(DwbUsr{
        name: "usr".to_string(),
        pwd:"123123".to_string()
    })
}


pub fn routes() ->Vec<Route>{
    routes![
        post_admin_login
    ]
}